#include "StdAfx.h"
#include "VectorEntityParameter.h"


const std::string VectorEntityParameter::TYPE_NAME = "vector";

VectorEntityParameter::VectorEntityParameter(std::string name)
{
	type = VectorEntityParameter::TYPE_NAME;
	this->name = name;

}

VectorEntityParameter::VectorEntityParameter(std::string name, Ogre::Vector3 value)
{

	type = VectorEntityParameter::TYPE_NAME;
	this->name = name;
	paramValue = value;

}




VectorEntityParameter::~VectorEntityParameter(void)
{
}


Ogre::Vector3 VectorEntityParameter::getVectorValue()
{

	return paramValue;
}
void VectorEntityParameter::setVectorValue(Ogre::Vector3 value)
{
	paramValue = value;

}

	
//For other types
void* VectorEntityParameter::getValue()
{
	return (void*)&paramValue;

}
void VectorEntityParameter::setValue(void* value)
{

	paramValue = (*(Ogre::Vector3*)value);
}

int VectorEntityParameter::operator-(EntityParameter &param)
{
	//std::string value((char*)param.getValue());
	Ogre::Vector3 diff = paramValue - (*(Ogre::Vector3*)param.getValue());

	return abs(diff.x)+abs(diff.y)+abs(diff.z);
}
